import SwiftUI

// UIViewController
class FCUIViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        let view = ChartExample(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height))
        view.backgroundColor = UIColor.white
        self.view.addSubview(view)
    }
}

struct ContentView: View {
    @Environment(\.presentationMode) var presentationMode
    @State var color : UIColor?
    var body: some View{
        VStack{
            SwiftUICallSwift(color: color)
        }.navigationBarTitle("FCUIViewController", displayMode: .inline)
            .navigationBarBackButtonHidden(true)
            .navigationBarItems(leading: Button(action: {
                presentationMode.wrappedValue.dismiss()
            }, label: {
                Image("nav_back_black")
            }))
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
